
spring:
  application:
      name: example-service
  config:
    import: "consul:"
  cloud:
    # https://docs.spring.io/spring-cloud-consul/docs/current/reference/html/#http-health-check
    consul:
      host: ${CONSUL_ADDRESS}
      port: ${CONSUL_PORT}
      config:
        enabled: true
        fail-fast: true
        prefixes:
          - config
        default-context: application
        name: example-service
        profile-separator: '::'
        format: YAML
        data-key: data
        watch:
          enabled: true
          delay: 1000

      discovery:
        instanceId: ${spring.application.name}_${vmhostname}
#        instanceId: ${spring.application.name}:${vcap.applica${}tion.instance_id:${spring.application.instance_id:${random.value}}}
        serviceName: ${spring.application.name}

        prefer-agent-address: false
        prefer-ip-address: true

        heartbeat:
#          use-actuator-health: false
#          actuator-health-group: <your-custom-group-goes-here>
         enabled: true
         ttl: 10s


        metadata:
          myfield: myvalue
          anotherfield: anothervalue
          service-port: ${DEMO_SERVICE_PORT}

#        healthCheckPath: /my-health-check
#        healthCheckInterval: 20s
server:
  port: ${DEMO_SERVICE_PORT}
